package com.alibaba.citrus.cr.unified.inventory.repository;

import com.epoch.app.crunifiedinventory.dto.request.AllocateOrderSalesOrderSyncRequest;
import com.epoch.app.crunifiedinventory.model.dto.UpdateAllocateApplyOrderBySapSyncRequest;
import com.epoch.app.crunifiedinventory.sdo.AllocateApplyOrderSDO;

/**
 * @author heyu
 * @description 调拨预报单写服务
 */
public interface AllocateApplyOrderWriteRepository {
    /**
     * 插入调拨预报单
     * @param allocateApplyOrderSDO
     * @return
     */
     String createAllocateApplyOrder(AllocateApplyOrderSDO allocateApplyOrderSDO);

    /**
     * 插入调拨预报单
     * @param allocateApplyOrderSDO
     * @return
     */
    String nykCreateAllocateApplyOrder(AllocateApplyOrderSDO allocateApplyOrderSDO);

    /**
     * 更新预调拨单
     * @param allocateApplyOrderSDO
     * @return
     */
     void updateAllocateApplyOrder(AllocateApplyOrderSDO allocateApplyOrderSDO);

    /**
     * 更新预报单和预报单明细
     * @param allocateApplyOrderSDO
     */
    void update(AllocateApplyOrderSDO allocateApplyOrderSDO);

    /**
     * 取消调拨单
     * @param allocateApplyOrderSDO
     */
    void cancel(AllocateApplyOrderSDO allocateApplyOrderSDO);

    /**
     * sap更新预报单
     * @param allocateApplyOrderSDO
     */
    void sapUpdate(AllocateApplyOrderSDO allocateApplyOrderSDO);

    /**
     * sap创建预报单
     * @param allocateApplyOrderSDO
     */
    void sapCreate(AllocateApplyOrderSDO allocateApplyOrderSDO);

    /**
     * 根据销售调拨单同步请求来修改预报单 主要是修改 回复数量 和状态
     */
    void updateByAllocateOrderWithLock(UpdateAllocateApplyOrderBySapSyncRequest updateRequest);
}
